package com.hptpd.questionnairesurvey.controller.wx;

import com.google.common.collect.Maps;
import com.hptpd.questionnairesurvey.component.Result;
import com.hptpd.questionnairesurvey.service.IQuestionnaireService;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RequestMethod;
import org.springframework.web.bind.annotation.RequestParam;
import org.springframework.web.bind.annotation.RestController;

import javax.annotation.Resource;
import java.util.Map;

/**
 * \* Created with IntelliJ IDEA.
 * \* Date: 2019/11/14
 * \*
 * \* Description:
 * \
 *
 * @author walter_long
 */
@RestController
@RequestMapping("/api/wx")
public class WxQuestionnaireController {
    @Resource(name = "iQuestionnaireService")
    private IQuestionnaireService iQuestionnaireService;
    /**
     * 微信小程序获取openid
     * @param userId String
     * @return Result
     */
    @RequestMapping(value = "/questionnaire", method = RequestMethod.GET)
    public Result getQuestionnaireByUserSurveyId(
            @RequestParam(defaultValue = "") String userId,
            @RequestParam(defaultValue = "") String userSurveyId){
        return iQuestionnaireService.getQuestionnaireByUserSurveyId(userId, userSurveyId);
    }
}
